package com.chenlonghai.sbmybatis.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.chenlonghai.sbmybatis.dao.ContactDao;
import com.chenlonghai.sbmybatis.entity.Contact;

import com.chenlonghai.sbmybatis.service.ContactService;

@Service
public class ContactServiceImpl implements ContactService {
	@Autowired
	private ContactDao contactDao;
	@Override
	public List<Contact> queryContact() {
		// TODO Auto-generated method stub
		return contactDao.queryContact();
	}
	@Override
	public boolean insertContact(Contact contact) {
		// TODO Auto-generated method stub
		boolean isOK = false;
		if(contact.getUserName() == null ||contact.getUserDesc()==null || contact.getUserPhone() == null )
		{
			return isOK;	
		}else{
			int row = contactDao.insertContact(contact);
			if (row > 0) {
				isOK = true;
			}
			return isOK;	
		}
		
	
	}

}
